<?php 
if($_POST)
{
	$username = $_POST['username'];
	$pass1 = $_POST['pass1'];
	$pass2 = $_POST['pass2'];
}
?>
<html>
<head>
</head>
<body>
<form method="post">
	<p>Username: <input name="username"/>
		<?php 
		if($_POST)
		{
			if($username == '')
			{
				echo "Enter username";
			}
		}
		?>
	</p>
	<p>Password: <input name="pass1" type="password"/></p>
	<p>Repeat: <input name="pass2" type="password"/></p>
	<p><input type="submit" value="Send Me!"/></p>
	<?php 
	if($_POST)
	{
		$passEncr = md5($pass1);
		echo "<p>Hello $username. Your pass is: $passEncr</p>";
	}	
	?>
</form>
</body>
</html>